<div class="row">
    <div class="col-xs-12">

        <form action="" method="POST" class="form-search">
            <table class="table table-striped table-bordered table-hover">
                <tr>
                    <td class="col-xs-3 col-sm-1">
                        <select id="search_type" name="search_type">
                            <option value="id" {{if eq "id" .search_type}}selected="selected"{{end}}>项目ID</option>
                            <option value="name" {{if eq "name" .search_type}}selected="selected"{{end}}>任务名称</option>
                        </select>
                    </td>

                    <td class="col-xs-3 col-sm-2">
                        <input type="text" name="search_word" value="{{.search_word}}" placeholder="关键词">
                    </td>

                    <td colspan="80">
                        <input type="button" name="search" onclick="go_search('index');" value="查询" class="btn btn-purple btn-sm"/>
                    </td>
                </tr>
            </table>
            <script type="text/javascript">
                function go_search($ac){
                    $('.form-search').attr('action',$ac).submit();
                }
            </script>
        </form>


        <div class="table-responsive">
            <table id="function-table"
                   class="table table-bordered table-hover">
                <thead>
                <tr>
                    <th class="col-sm-1">序号</th>
                    <th class="col-sm-1">项目ID</th>
                    <th class="col-sm-1">任务名称</th>
                    <th class="col-sm-1">执行次数</th>
                    <th class="col-sm-2">上次执行时间</th>
                    <th class="col-sm-2">更新时间</th>
                    <th class="col-sm-2">创建时间</th>
                    <th style="width: 80px;">状态</th>
                    <th>
                        <a class="blue" title="新增项目" href="/{{.curController}}/add">
                            <i class="glyphicon glyphicon-plus bigger-130"></i>
                        </a>
                    </th>
                </tr>
                </thead>


                <tbody>
                    {{range  $k, $v := .list}}
                    <tr>
                        <td>{{$v.Id}}</td>
                        <td>{{$v.ItemId}}</td>
                        <td>{{$v.Name}}</td>
                        <td>{{$v.ExecNum}}</td>
                        <td>{{$v.PrevTime}}</td>
                        <td>{{$v.UpdateTime}}</td>
                        <td>{{$v.CreateTime}}</td>
                        <td>
                            {{if eq 1 $v.Status}}
                            <a class="blue" href="javascript:req('/{{$.curController}}/lock?id={{$v.Id}}')">
                                <span title="点击锁定" class="badge badge-warning">正常</span></a>
                            {{else}}
                            <a class="blue" href="javascript:req('/{{$.curController}}/lock?id={{$v.Id}}')">
                                <span title="点击解锁" class="badge">锁定</span></a>
                            {{end}}
                        </td>
                        <td>
                            <div class="visible-md visible-lg action-buttons">
                                <a class="blue" title="编辑" href="/{{$.curController}}/add?id={{$v.Id}}">
                                    <i class="fa fa-pencil bigger-130"></i>
                                </a>
                                {{if eq 1 $v.Status}} 
                                <a class="blue" title="点击锁定" href="javascript:req('/{{$.curController}}/lock?id={{$v.Id}}')">
                                    <i class="fa fa-unlock bigger-130"></i>
                                </a> 
                                {{else}} 
                                <a class="blue" title="点击解锁" href="javascript:req('/{{$.curController}}/lock?id={{$v.Id}}')">
                                <i class=" fa fa-lock bigger-130"></i>
                                </a> 
                                {{end}}
                                <a class="blue" title="删除"
                                   href="javascript:req('/{{$.curController}}/del?id={{$v.Id}}')">
                                    <i class="fa fa-trash-o bigger-130"></i>
                                </a>
                        </td>
                    </tr>
                    {{end}}
                </tbody>
            </table>
        </div>
    </div>
</div>
<div class="row">
    <div class="col-xs-12">
        <div class="dataTables_paginate paging_bootstrap">{{str2html .pageLink}}</div>
    </div>
</div>

<script>
jQuery(function($) {
});
</script>
